package com.xit.hitmouse.ui;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.xit.hitmouse.Bean.PropsBean;
import com.xit.hitmouse.adapter.PropsAdapter;
import com.xit.hitmouse.R;

import java.util.ArrayList;

/**
 * @author 厦工 友敏612
 * @Date 2023/11/24
 */
public class ShopActivity   extends Activity {

    private RecyclerView recyclerView;
    private PropsAdapter adapter; // 更改适配器的命名为 PropsAdapter
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.shop);

        ArrayList<PropsBean> props = new ArrayList<>();
        props.add(new PropsBean(R.drawable.p1 , "吞金兽","自动收集 消灭怪物后随机掉落的金币"));
        props.add(new PropsBean(R.drawable.c1 , "吞金兽","自动收集 消灭怪物后随机掉落的金币"));
        props.add(new PropsBean(R.drawable.c1 , "吞金兽","自动收集 消灭怪物后随机掉落的金币"));
        props.add(new PropsBean(R.drawable.c1 , "吞金兽","自动收集 消灭怪物后随机掉落的金币"));


        recyclerView = findViewById(R.id.recycler_view);
        adapter = new PropsAdapter(props); // 使用 PropsAdapter 并传入适当的数据
        //使用网格布局，每行只有三个
        RecyclerView.LayoutManager layoutManager = new GridLayoutManager(this, 3);
        recyclerView.setLayoutManager(layoutManager);
        recyclerView.setAdapter(adapter);
    }

}
